package com.vinci.webtrading.dao.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;


@Entity
@Table(name="DEVISE")

public class Devise {
	
	private Integer id;
	private String libelleDevise;
	private Double tauxVente;
	private Double tauxAchat;
	private Double variation;
	private Operation operation;
	private Variation courbe;
	
	public Devise() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="DEVISE_ID")
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name="LIBELLEDEVISE")
	public String getLibelleDevise() {
		return libelleDevise;
	}
	public void setLibelleDevise(String libelleDevise) {
		this.libelleDevise = libelleDevise;
	}
	@Column(name="TAUXVENTE")
	public Double getTauxVente() {
		return tauxVente;
	}
	public void setTauxVente(Double tauxVente) {
		this.tauxVente = tauxVente;
	}
	
	@Column(name="TAUXACHAT")
	public Double getTauxAchat() {
		return tauxAchat;
	}
	public void setTauxAchat(Double tauxAchat) {
		this.tauxAchat = tauxAchat;
	}
	
	@Column(name="VARIATION")
	public Double getVariation() {
		return variation;
	}
	public void setVariation(Double variation) {
		this.variation = variation;
	}
	
			
	@ManyToOne
	@JoinColumn(name="OPERATION_ID")
	public Operation getOperation() {
		return operation;
	}

	public void setOperation(Operation operation) {
		this.operation = operation;
	}
	
	@OneToOne(optional=false)
    @JoinColumn(name="VARIATIONA_ID")
	public Variation getCourbe() {
		return courbe;
	}
	public void setCourbe(Variation courbe) {
		this.courbe = courbe;
	}
	@Override
	public String toString() {
		return "Devises [id=" + id + ", libelleDevise=" + libelleDevise
				+ ", tauxVente=" + tauxVente + ", tauxAchat=" + tauxAchat
				+ ", variation=" + variation + "]";
	}

	

}

